package criticalsection;
public class FileLogger implements Logger {
	private static FileLogger logger;

	private FileLogger() {
	}

	public synchronized static FileLogger getFileLogger() {
		if (logger == null) {
			logger = new FileLogger();
		}
		return logger;
	}
	private static int cont = 0;
	public synchronized void log(String msg) {
		FileUtil futil = new FileUtil();
		futil.writeToFile("log",msg, true, true);
		cont ++;
		System.out.println(""+cont );
	}
}
